<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/axios.js"></script>
</head>

<body>
    <script>

        // axios.get("http://localhost:3000/axios", {
        //     params: {
        //         username: "123"
        //     }
        // }).then((result) => {
        //     console.log(result.data);
        // })


        //全局配置一个域名
        axios.defaults.baseURL = "http://localhost:3000/"


        axios.get("axios", {
            params: {
                username: "123"
            }
        }).then((result) => {
            console.log(result.data);
        })

        axios.get("haogu1").then((result) => {
            console.log(result.data);
        })
    </script>
</body>

</html>